<admintpl file="header"/>
</head>
<body>
<style type="text/css">
	p {margin-bottom:25px;}
</style>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('Admin/Movement/add1')}">通知添加</a></li>
    </ul>
    
			<tbody >
			<form class="well form-search" action="{:U('Admin/Movement/addok1')}" method="post" onsubmit="return check()" >
					<p>
						通知标题：
						<input style="height:35px" type="text" value='{$value.title}' name="title" />
					</p>
					<p>
						通知内容：
						<textarea value="{$value.content}" name="content" id="content" cols="30" rows="10" style="width: 400px;">{$value.content}</textarea>
						<span id="s1" style="color:red"></span>
					</p>
					<p>
						url:<input style="width:150px;height:35px" type="text" value='{$value.url}' name="url" />
							<input type="radio" id="time" name="is_time" value='1'/>定时推送
							<span id="timetype" style="display:none;">
								<input type="text" id="start_time" name="start_time" style="width:185px;height:35px" />
								<input type="text" id="end_time" name="end_time" style="width:185px;height:35px" />	
							</span>
					</p>
					<input class="btn btn-primary" id="btnSubmit" type="submit" value="发送" />
				</form>
			</tbody>
</div>
</body>
</html>
<script src="__PUBLIC__/js/2.1.4jquery.js"></script>
<script src="__PUBLIC__/jsDate/jedate.js"></script>
<script type="text/javascript">
	//判断
    $("input[name=is_time]").click(function(){
		$("#timetype").show();
	})


	//表单验证
	function check(){
		var val=$('input:radio[name="is_time"]:checked').val();
        if(val==null){
            $("#timetype").attr("disabled", true); 
        }

		if(confirm('确定发送？'))
		{
			//内容非空
			$("#content").blur(function(){
				var content=$("#content").val();
				if(content==''){
					$("#s1").html('*内容不能为空');
					return false;
				}
			})
		}else{
		  return false;
		}
	}
</script>